import 'package:flutter/material.dart';
import 'package:get/get.dart';

import '../columnar_chart.dart';
import '../dragable_widget.dart';
import 'animated_switcher_route.dart';
import 'animated_widget_test.dart';
import 'scale_animation_route.dart';
import 'stagger_route.dart';

class AnimatedDemoRoute extends StatelessWidget {
  const AnimatedDemoRoute({super.key});

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(title: Text(' animated demo route')),
      body: SingleChildScrollView(
        child: Column(
          children: [
            ElevatedButton(
              child: Text('柱状图'),
              style: ButtonStyle(
                backgroundColor: MaterialStateProperty.all(Colors.orange),
                overlayColor: MaterialStateProperty.all(Colors.yellow),
              ),
              onPressed: () => Get.to(() => ColumnarChart()),
            ),

            ElevatedButton(
              child: Text('Dragable拖拽控件'),
              style: ButtonStyle(
                backgroundColor: MaterialStateProperty.all(Colors.orange),
                overlayColor: MaterialStateProperty.all(Colors.yellow),
              ),
              onPressed: () => Get.to(() => DragableWidget()),
            ),
            TextButton(
              child:
                  Hero(tag: 'scale_animation_route', child: Text('图片放大/缩小 动画')),
              style: ButtonStyle(
                backgroundColor: MaterialStateProperty.all(Colors.orange),
                overlayColor: MaterialStateProperty.all(Colors.yellow),
              ),
              onPressed: () => Get.to(
                () => ScaleAnimationRoute(),
              ),
            ),

            // 交织动画
            StaggerRoute(),

            // 动画切换组件
            AnimatedSwitcherRoute(),

            //Flutter预制的动画过渡组件
            AnimatedWidgetTest(),
          ].map((e) => Column(children: [e, Divider()])).toList(),
        ),
      ),
    );
  }
}
